package org.future.wsdl.data;

import javax.xml.namespace.QName;

/**
 * wsdl:port 元素信息
 * @author dycc
 *
 */
public class WsdlPort {
    private String name;
    
    private QName binding;
    
    private QName addr_type;
    
    private String address;
    
    private WsdlBinding wsdlBinding;
    
    private WsdlService wsdlService;
    
    // name
    public String getName() {
        return name;
    }
    public void setName(String name) {
        this.name = name;
    }
    // binding 
    public QName getBinding() {
        return binding;
    }
    public void setBinding(QName binding) {
        this.binding = binding;
    }
    // address_type
    public QName getAddr_type() {
        return addr_type;
    }
    public void setAddr_type(QName addrType) {
        addr_type = addrType;
    }
    // address
    public String getAddress() {
        return address;
    }
    public void setAddress(String address) {
        this.address = address;
    }
    // wsdlBinding
    public WsdlBinding getWsdlBinding() {
        return wsdlBinding;
    }
    public void setWsdlBinding(WsdlBinding wsdlBinding) {
        this.wsdlBinding = wsdlBinding;
    }
    // wsdlService
    public WsdlService getWsdlService() {
        return wsdlService;
    }
    public void setWsdlService(WsdlService wsdlService) {
        this.wsdlService = wsdlService;
    }
    
    // toString
    public String toString(){
        StringBuffer sb = new StringBuffer();
        sb.append("<wsdl:port name=\"" + name + "\"");
        sb.append(" binding=\"" + binding.getPrefix() + ":" + binding.getLocalPart() + "\"");
        sb.append(">\n");
        sb.append("<" + addr_type.getPrefix() + ":" + addr_type.getLocalPart());
        sb.append(" location=\"" + address + "\"");
        sb.append(" />");
        sb.append("\n");
        sb.append("</wsdl:port>");
        return sb.toString();
    }
}
